<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActiveSupport::Testing</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActiveSupport::Testing</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/activesupport/lib/active_support/testing/default_rb.html">
                vendor/rails/activesupport/lib/active_support/testing/default.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/activesupport/lib/active_support/testing/performance_rb.html">
                vendor/rails/activesupport/lib/active_support/testing/performance.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown_rb.html">
                vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000405">full_test_name</a>&nbsp;&nbsp;
      <a href="#M000404">included</a>&nbsp;&nbsp;
      <a href="#M000410">included</a>&nbsp;&nbsp;
      <a href="#M000406">run</a>&nbsp;&nbsp;
      <a href="#M000409">run_profile</a>&nbsp;&nbsp;
      <a href="#M000407">run_test</a>&nbsp;&nbsp;
      <a href="#M000408">run_warmup</a>&nbsp;&nbsp;
      <a href="#M000411">run_with_callbacks_and_miniunit</a>&nbsp;&nbsp;
      <a href="#M000412">run_with_callbacks_and_mocha</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="Callbacks.html">ActiveSupport::Callbacks</a></span>
      </div>
    </div>

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="Testing/Metrics.html" class="link">ActiveSupport::Testing::Metrics</a><br />
Module <a href="Testing/Performance.html" class="link">ActiveSupport::Testing::Performance</a><br />
Module <a href="Testing/SetupAndTeardown.html" class="link">ActiveSupport::Testing::SetupAndTeardown</a><br />
Class <a href="Testing/Benchmarker.html" class="link">ActiveSupport::Testing::Benchmarker</a><br />
Class <a href="Testing/Performer.html" class="link">ActiveSupport::Testing::Performer</a><br />
Class <a href="Testing/Profiler.html" class="link">ActiveSupport::Testing::Profiler</a><br />

    </div>




      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000404" class="method-detail">
        <a name="M000404"></a>

        <div class="method-heading">
          <a href="#M000404" class="method-signature">
          <span class="method-name">included</span><span class="method-args">(base)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000404-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000404-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 26</span>
26:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
27:         <span class="ruby-identifier">base</span>.<span class="ruby-identifier">superclass_delegating_accessor</span> <span class="ruby-identifier">:profile_options</span>
28:         <span class="ruby-identifier">base</span>.<span class="ruby-identifier">profile_options</span> = <span class="ruby-constant">DEFAULTS</span>
29:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000410" class="method-detail">
        <a name="M000410"></a>

        <div class="method-heading">
          <a href="#M000410" class="method-signature">
          <span class="method-name">included</span><span class="method-args">(base)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000410-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000410-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb, line 12</span>
12:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
13:         <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
14:           <span class="ruby-identifier">include</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Callbacks</span>
15:           <span class="ruby-identifier">define_callbacks</span> <span class="ruby-identifier">:setup</span>, <span class="ruby-identifier">:teardown</span>
16: 
17:           <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Mini</span>)
18:             <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">:run</span>
19:             <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:run</span>, <span class="ruby-identifier">:run_with_callbacks_and_miniunit</span>
20:           <span class="ruby-keyword kw">else</span>
21:             <span class="ruby-keyword kw">begin</span>
22:               <span class="ruby-identifier">require</span> <span class="ruby-value str">'mocha'</span>
23:               <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">:run</span>
24:               <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:run</span>, <span class="ruby-identifier">:run_with_callbacks_and_mocha</span>
25:             <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
26:               <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">:run</span>
27:               <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">:run</span>, <span class="ruby-identifier">:run_with_callbacks_and_testunit</span>
28:             <span class="ruby-keyword kw">end</span>
29:           <span class="ruby-keyword kw">end</span>
30:         <span class="ruby-keyword kw">end</span>
31:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000405" class="method-detail">
        <a name="M000405"></a>

        <div class="method-heading">
          <a href="#M000405" class="method-signature">
          <span class="method-name">full_test_name</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000405-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000405-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 31</span>
31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">full_test_name</span>
32:         <span class="ruby-node">&quot;#{self.class.name}##{method_name}&quot;</span>
33:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000406" class="method-detail">
        <a name="M000406"></a>

        <div class="method-heading">
          <a href="#M000406" class="method-signature">
          <span class="method-name">run</span><span class="method-args">(result) {|self.class::STARTED, name| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000406-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000406-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 35</span>
35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">result</span>)
36:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^default_test$/</span>
37: 
38:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">STARTED</span>, <span class="ruby-identifier">name</span>)
39:         <span class="ruby-ivar">@_result</span> = <span class="ruby-identifier">result</span>
40: 
41:         <span class="ruby-identifier">run_warmup</span>
42:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">profile_options</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">metrics</span> = <span class="ruby-identifier">profile_options</span>[<span class="ruby-identifier">:metrics</span>]
43:           <span class="ruby-identifier">metrics</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">metric_name</span><span class="ruby-operator">|</span>
44:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span> = <span class="ruby-constant">Metrics</span>[<span class="ruby-identifier">metric_name</span>.<span class="ruby-identifier">to_sym</span>]
45:               <span class="ruby-identifier">run_profile</span>(<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>)
46:               <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add_run</span>
47:             <span class="ruby-keyword kw">end</span>
48:           <span class="ruby-keyword kw">end</span>
49:         <span class="ruby-keyword kw">end</span>
50: 
51:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span><span class="ruby-operator">::</span><span class="ruby-constant">FINISHED</span>, <span class="ruby-identifier">name</span>)
52:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000407" class="method-detail">
        <a name="M000407"></a>

        <div class="method-heading">
          <a href="#M000407" class="method-signature">
          <span class="method-name">run_test</span><span class="method-args">(metric, mode)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000407-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000407-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 54</span>
54:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_test</span>(<span class="ruby-identifier">metric</span>, <span class="ruby-identifier">mode</span>)
55:         <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:setup</span>
56:         <span class="ruby-identifier">setup</span>
57:         <span class="ruby-identifier">metric</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">mode</span>) { <span class="ruby-identifier">__send__</span> <span class="ruby-ivar">@method_name</span> }
58:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionFailedError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
59:         <span class="ruby-identifier">add_failure</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>)
60:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>
61:         <span class="ruby-identifier">add_error</span>(<span class="ruby-identifier">$!</span>)
62:       <span class="ruby-keyword kw">ensure</span>
63:         <span class="ruby-keyword kw">begin</span>
64:           <span class="ruby-identifier">teardown</span>
65:           <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:teardown</span>, <span class="ruby-identifier">:enumerator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:reverse_each</span>
66:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionFailedError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
67:           <span class="ruby-identifier">add_failure</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>)
68:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>
69:           <span class="ruby-identifier">add_error</span>(<span class="ruby-identifier">$!</span>)
70:         <span class="ruby-keyword kw">end</span>
71:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000411" class="method-detail">
        <a name="M000411"></a>

        <div class="method-heading">
          <a href="#M000411" class="method-signature">
          <span class="method-name">run_with_callbacks_and_miniunit</span><span class="method-args">(runner)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000411-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000411-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb, line 33</span>
33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_with_callbacks_and_miniunit</span>(<span class="ruby-identifier">runner</span>)
34:         <span class="ruby-identifier">result</span> = <span class="ruby-value str">'.'</span>
35:         <span class="ruby-keyword kw">begin</span>
36:           <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:setup</span>
37:           <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">super</span>
38:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
39:           <span class="ruby-identifier">result</span> = <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">puke</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">e</span>)
40:         <span class="ruby-keyword kw">ensure</span>
41:           <span class="ruby-keyword kw">begin</span>
42:             <span class="ruby-identifier">teardown</span>
43:             <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:teardown</span>, <span class="ruby-identifier">:enumerator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:reverse_each</span>
44:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
45:             <span class="ruby-identifier">result</span> = <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">puke</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">e</span>)
46:           <span class="ruby-keyword kw">end</span>
47:         <span class="ruby-keyword kw">end</span>
48:         <span class="ruby-identifier">result</span>
49:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000412" class="method-detail">
        <a name="M000412"></a>

        <div class="method-heading">
          <a href="#M000412" class="method-signature">
          <span class="method-name">run_with_callbacks_and_mocha</span><span class="method-args">(result) {|Test::Unit::TestCase::STARTED, name| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Doubly unfortunate: mocha does the same so we have to hax their hax.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000412-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000412-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb, line 84</span>
 84:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_with_callbacks_and_mocha</span>(<span class="ruby-identifier">result</span>)
 85:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@method_name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;default_test&quot;</span>
 86: 
 87:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span><span class="ruby-operator">::</span><span class="ruby-constant">STARTED</span>, <span class="ruby-identifier">name</span>)
 88:         <span class="ruby-ivar">@_result</span> = <span class="ruby-identifier">result</span>
 89:         <span class="ruby-keyword kw">begin</span>
 90:           <span class="ruby-identifier">mocha_setup</span>
 91:           <span class="ruby-keyword kw">begin</span>
 92:             <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:setup</span>
 93:             <span class="ruby-identifier">setup</span>
 94:             <span class="ruby-identifier">__send__</span>(<span class="ruby-ivar">@method_name</span>)
 95:             <span class="ruby-identifier">mocha_verify</span> { <span class="ruby-identifier">add_assertion</span> }
 96:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Mocha</span><span class="ruby-operator">::</span><span class="ruby-constant">ExpectationError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
 97:             <span class="ruby-identifier">add_failure</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>)
 98:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionFailedError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
 99:             <span class="ruby-identifier">add_failure</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>)
100:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>
101:             <span class="ruby-identifier">add_error</span>(<span class="ruby-identifier">$!</span>)
102:           <span class="ruby-keyword kw">ensure</span>
103:             <span class="ruby-keyword kw">begin</span>
104:               <span class="ruby-identifier">teardown</span>
105:               <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:teardown</span>, <span class="ruby-identifier">:enumerator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:reverse_each</span>
106:             <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionFailedError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
107:               <span class="ruby-identifier">add_failure</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>)
108:             <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>
109:               <span class="ruby-identifier">add_error</span>(<span class="ruby-identifier">$!</span>)
110:             <span class="ruby-keyword kw">end</span>
111:           <span class="ruby-keyword kw">end</span>
112:         <span class="ruby-keyword kw">ensure</span>
113:           <span class="ruby-identifier">mocha_teardown</span>
114:         <span class="ruby-keyword kw">end</span>
115:         <span class="ruby-identifier">result</span>.<span class="ruby-identifier">add_run</span>
116:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span><span class="ruby-operator">::</span><span class="ruby-constant">FINISHED</span>, <span class="ruby-identifier">name</span>)
117:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000409" class="method-detail">
        <a name="M000409"></a>

        <div class="method-heading">
          <a href="#M000409" class="method-signature">
          <span class="method-name">run_profile</span><span class="method-args">(metric)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000409-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000409-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 84</span>
84:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_profile</span>(<span class="ruby-identifier">metric</span>)
85:           <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">profile_options</span>[<span class="ruby-identifier">:benchmark</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">Benchmarker</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Profiler</span>
86:           <span class="ruby-identifier">performer</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">metric</span>)
87: 
88:           <span class="ruby-identifier">performer</span>.<span class="ruby-identifier">run</span>
89:           <span class="ruby-identifier">puts</span> <span class="ruby-identifier">performer</span>.<span class="ruby-identifier">report</span>
90:           <span class="ruby-identifier">performer</span>.<span class="ruby-identifier">record</span>
91:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000408" class="method-detail">
        <a name="M000408"></a>

        <div class="method-heading">
          <a href="#M000408" class="method-signature">
          <span class="method-name">run_warmup</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000408-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000408-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/testing/performance.rb, line 74</span>
74:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_warmup</span>
75:           <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
76: 
77:           <span class="ruby-identifier">time</span> = <span class="ruby-constant">Metrics</span><span class="ruby-operator">::</span><span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
78:           <span class="ruby-identifier">run_test</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">:benchmark</span>)
79:           <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;%s (%s warmup)&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">full_test_name</span>, <span class="ruby-identifier">time</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">time</span>.<span class="ruby-identifier">total</span>)]
80: 
81:           <span class="ruby-constant">GC</span>.<span class="ruby-identifier">start</span>
82:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>